package com.heima.article.controller.v1;

import com.heima.apis.user.IUserClient;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.dtos.UserRelatinDto;
import com.heima.utils.thread.ApThreadLocalUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/user")
public class ArticleFollowController {
    @Autowired
    IUserClient iUserClient;
    @PostMapping("user_follow")
    public ResponseResult follow(@RequestBody UserRelatinDto userRelatinDto){
        userRelatinDto.setUserid( ApThreadLocalUtils.getUser().getId());
       return iUserClient.followhandle(userRelatinDto);
    }
}
